import axios from "axios";
import type { InternalAxiosRequestConfig, AxiosResponse } from "axios";

const service = axios.create({
    baseURL: "http://118.178.238.19:3001/admin"
});


service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
    config.headers.token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZG1pbm5hbWUiOiJhZG1pbiIsImlhdCI6MTY3NzQ1NzA5NSwiZXhwIjoxNjc3NDg1ODk1fQ.cQPXCttx8iXfEDI560Sx_IDxkEfLj7BkXKOBfvaJZA4";
    return config;
});

// 请求拦截器

service.interceptors.response.use((res: AxiosResponse) => {
    return res;
});

//响应拦截器
export default service;